package com.sunducation.co.cw.equalsAndHashCode;

/**
 * @description: 测试@EqualsAndHashCode注解的使用
 * https://blog.csdn.net/qq_27093465/article/details/90056695
 * @author:chenwenbiao
 * @createTime:2019/7/9 10:06
 * @version：1.0
 **/
public class EqualsAndHashCodeTest {
    public static void main(String[] args) {

        XiaoMiTV tv1 = new XiaoMiTV(123, "小米", 1f, "白");
        XiaoMiTV tv2 = new XiaoMiTV(456, "中米", 1f, "白");

        /**
         * 当XiaoMiTV类添加@EqualsAndHashCode(callSuper = true)输出正确结果false
         * 否则结果为true，即两对象相等
         */
        System.out.println(tv1.equals(tv2));
    }
}